package a.j;

import javax.swing.*;
import java.awt.*;
import java.awt.dnd.Autoscroll;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;

public class mf
  extends gf
{
  private Timer m;
  private a_ G;
  private static boolean H = false;
  public static boolean I;
  
  public mf()
  {
    d(false);
    this.G = new a_();
  }
  
  Autoscroll v()
  {
    return (Autoscroll)this.i.B();
  }
  
  public void w()
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.i != null)
      {
        this.i = null;
        this.G = null;
      }
    }
    if ((bool) || (this.m != null))
    {
      this.m.stop();
      this.m = null;
    }
  }
  
  public void a(int paramInt1, int paramInt2, MouseEvent paramMouseEvent)
  {
    boolean bool = ld.E;
    if (this.G == null) {
      return;
    }
    if (!bool) {
      if (paramInt1 == 0) {
        if (bool) {
          break label32;
        }
      }
    }
    label32:
    int i = paramInt2 != 0 ? 1 : 0;
    this.G.b = paramInt1;
    this.G.c = paramInt2;
    if (!bool)
    {
      this.G.a = paramMouseEvent;
      if (i != 0)
      {
        if (!bool) {
          if (this.m == null)
          {
            this.m = new Timer(100, this.G);
            this.m.setCoalesce(false);
            this.m.setInitialDelay(200);
          }
        }
        if (!bool)
        {
          if (this.m.isRunning()) {
            return;
          }
          if (bool) {
            break label156;
          }
          this.m.restart();
        }
        if (!ld.D) {
          return;
        }
      }
    }
    label156:
    if (((bool) || (this.m != null)) && ((bool) || (this.m.isRunning()))) {
      this.m.stop();
    }
  }
  
  public void mouseExited(MouseEvent paramMouseEvent)
  {
    a(0, 0, null);
  }
  
  public void mouseClicked(MouseEvent paramMouseEvent)
  {
    a(0, 0, null);
  }
  
  public void mousePressed(MouseEvent paramMouseEvent)
  {
    a(0, 0, null);
  }
  
  public void mouseReleased(MouseEvent paramMouseEvent)
  {
    a(0, 0, null);
  }
  
  public void mouseDragged(MouseEvent paramMouseEvent)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    int i = paramMouseEvent.getX();
    int j = paramMouseEvent.getY();
    Dimension localDimension = this.i.I();
    int k = 0;
    int n = 0;
    Insets localInsets = v().getAutoscrollInsets();
    if (!bool2) {
      if (i < localInsets.left)
      {
        k = i - localInsets.right;
        if (bool2) {
          break label115;
        }
        if (!bool1) {
          break label114;
        }
      }
    }
    if (!bool2) {
      if (i > localDimension.width - localInsets.right) {
        k = i - (localDimension.width - localInsets.right);
      }
    }
    label114:
    label115:
    if (!bool2) {
      if (j < localInsets.top)
      {
        n = j - localInsets.top;
        if (bool2) {
          return;
        }
        if (!bool1) {
          break label182;
        }
      }
    }
    if ((bool2) || (j > localDimension.height - localInsets.bottom)) {
      n = j - (localDimension.height - localInsets.bottom);
    }
    label182:
    a(k, n, paramMouseEvent);
  }
  
  final class a_
    implements ActionListener
  {
    MouseEvent a;
    int b;
    int c;
    
    a_() {}
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      if ((ld.E) || (mf.this.i != null))
      {
        Point2D localPoint2D = mf.this.i.S();
        double d = mf.this.i.M();
        mf.this.i.b(localPoint2D.getX() + this.b / (d * 3.0D), localPoint2D.getY() + this.c / (d * 3.0D));
        mf.this.i.b();
        MouseEvent localMouseEvent1 = this.a;
        if (localMouseEvent1 != null)
        {
          MouseEvent localMouseEvent2 = null;
          if (!mf.H) {
            try
            {
              localMouseEvent2 = new MouseEvent(mf.this.i.B(), 506, paramActionEvent.getWhen(), localMouseEvent1.getModifiers(), localMouseEvent1.getX(), localMouseEvent1.getY(), localMouseEvent1.getClickCount(), localMouseEvent1.isPopupTrigger(), localMouseEvent1.getButton());
            }
            catch (LinkageError localLinkageError)
            {
              mf.access$002(true);
            }
          }
          if (mf.H) {
            localMouseEvent2 = new MouseEvent(mf.this.i.B(), 506, 0L, localMouseEvent1.getModifiers(), localMouseEvent1.getX(), localMouseEvent1.getY(), localMouseEvent1.getClickCount(), localMouseEvent1.isPopupTrigger());
          }
          mf.this.i.B().dispatchEvent(localMouseEvent2);
        }
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.mf

 * JD-Core Version:    0.7.0.1

 */